import React from "react";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import "./App.less";
import Home from "./views/home/index";
import Cart from "./views/cart/index";
import My from "./views/my/index";
import Login from "./views/login/index";
import Demo from "./views/demo/index";

class App extends React.Component {
  constructor() {
    super();
  }

  render() {
    return (
      <Router>
        {/* 路由配置 */}
        <Switch>
          <Route path="/home" component={Home} />
          <Route path="/cart" component={Cart} />
          <Route path="/my" component={My} />
          <Route path="/login" component={Login} />
          <Route path="/demo" component={Demo} />
          <Route path="/" component={Home} />
        </Switch>
      </Router>
    );
  }
}

export default App;
